<template>
  <div class="container">
    <el-tabs type="border-card">
      <!-- 基础顶部筛选组件引入 -->
      <QuestionsFilter @done="doneData" ref="QuestionsFilter"></QuestionsFilter>
      <!-- 基础内容组件引入 -->
      <QuestionsContent :counts="getCounts" :questionList="getQuestionList" @data-updated="handleDataUpdated"></QuestionsContent>
    </el-tabs>
  </div>
</template>

<script>
import QuestionsContent from '../components/questions/questions-content.vue'
import QuestionsFilter from '../components/questions/questions-filter.vue'
export default {
  components: {
    QuestionsFilter,
    QuestionsContent
  },
  data () {
    return {
      getCounts: 0,
      getQuestionList: []
    }
  },
  methods: {
    doneData (counts, questionList) {
      this.getCounts = counts
      this.getQuestionList = questionList
    },
    handleDataUpdated () {
      this.$refs.QuestionsFilter.getQuestionList()
    }
  }
}
</script>

<style scoped lang="scss">
.container {
  margin: 0 10px;
  padding: 10px 0;
}
</style>
